import request from "@/utils/request";

/**
 * 分页查询轮播图
 * @returns {AxiosPromise}
 */
export function page(param) {
    return request({
        url: '/carousel/page',
        method: 'get',
        params: param
    })
}

/**
 * 添加轮播图
 * @returns {AxiosPromise}
 */
export function add(param) {
    return request({
        url: '/carousel/add',
        method: 'post',
        data: param
    })
}

/**
 * 修改轮播图
 * @returns {AxiosPromise}
 */
export function update(param, uuid) {
    return request({
        url: '/carousel/update/' + uuid,
        method: 'put',
        data: param
    })
}

/**
 * 删除轮播图
 * @returns {AxiosPromise}
 */
export function deleted(uuid) {
    return request({
        url: '/carousel/delete/' + uuid,
        method: 'delete',
    })
}

/**
 * 启用轮播图
 * @returns {AxiosPromise}
 */
export function enable(uuid) {
    return request({
        url: '/carousel/enable/' + uuid,
        method: 'put',
    })
}

/**
 * 禁用轮播图
 * @returns {AxiosPromise}
 */
export function disable(uuid) {
    return request({
        url: '/carousel/disable/' + uuid,
        method: 'put',
    })
}